//
//  DrawLotteryCell.m
//  WangLottery
//
//  Created by leven hu on 12-8-15.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "DrawLotteryCell.h"


@implementation DrawLotteryCell

@synthesize lotterType=_lotterType;
@synthesize lotterName=_lotterName;
@synthesize lotterInfo=_lotterInfo;
@synthesize lotterRadNum=_lotterRadNum;
@synthesize lotterBlueNum=_lotterBlueNum;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)dealloc{

    [_lotterName release];
    [_lotterInfo release];
    [_lotterType release];
    
    [_lotterRadNum release];
    [_lotterBlueNum release];
    
    [super dealloc];
}

- (void)setCellFrame{

    _lotterType=[[UIImageView alloc]initWithFrame:CGRectMake(5, 5, 50, 50)];
    _lotterType.userInteractionEnabled=NO;
    
    [self addSubview:_lotterType];
    
    _lotterName=[[UILabel alloc]initWithFrame:CGRectMake(spacing, 0, 100, 20)];
    _lotterName.backgroundColor=[UIColor clearColor];
    _lotterName.textColor=[UIColor orangeColor];
    _lotterName.userInteractionEnabled=NO;
    
    [self addSubview:_lotterName];
    
    _lotterInfo=[[UILabel alloc] initWithFrame:CGRectMake(spacing, _lotterName.frame.size.height, self.frame.size.width,20)];
    _lotterInfo.font=[UIFont systemFontOfSize:14.0];
    _lotterInfo.userInteractionEnabled=NO;
    
    [self addSubview:_lotterInfo];
    
}

- (void)setLotterRadNum:(NSString *)lotterRadNum{
    
    UIFont *font=[UIFont systemFontOfSize:16.0];
    CGSize singleLineStringSize = [lotterRadNum sizeWithFont:font];

    UILabel *radNum=[[UILabel alloc]initWithFrame:CGRectMake(spacing, 40, singleLineStringSize.width, 20)];
    radNum.textColor=[UIColor orangeColor];
    radNum.font=font;
    
    [radNum setText:lotterRadNum];
    
    radNum.tag=10;
    
    [self addSubview:radNum];
    
    [radNum release];
    
}

- (void)setLotterBlueNum:(NSString *)lotterBlueNum{
    
    UILabel *lab=(UILabel *)[self viewWithTag:10];

    UILabel *blueNum=[[UILabel alloc]initWithFrame:CGRectMake(lab.frame.size.width+lab.frame.origin.x+10, 40, self.frame.size.width, 20)];
    blueNum.textColor=[UIColor blueColor];
    [blueNum setText:lotterBlueNum];
    
    
    [self addSubview:blueNum];
    
    [blueNum release];
    

}

@end
